<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="co.gov.medellin.ssti.sub.common.util.Utility"%>
<%@page import="org.directwebremoting.guice.SessionScoped"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/displaytag-11.tld" prefix="display"%>

<html>
<head>
<script type="text/javascript"
	src="<%=request.getContextPath() + "/js/jquery-1.8.0.js"%>"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()
					+ "/js/jquery-ui-1.10.3.custom.min.js"%>"></script>
<link rel="stylesheet"
	href="<%=request.getContextPath()
					+ "/css/ui-lightness/jquery-ui-1.10.3.custom.css"%>" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title>
<script type="text/javascript">
$(document).ready(function(){
	$("input[id='operacion']").val('');
	$("#programas").change(function(){		
		$("input[id='codigoEmpresa']").val("<%= request.getParameter("codigoEmpresa") %>");
		$("#mainForm").submit();
	});
	
	$("#continuarBtn").click(function(){
		if($("#programas").val() == ''){
			alert("Seleccione un programa");
			return false;
		}
		if($("#subprogramas").val() == ''){			
			alert("Seleccione un subprograma.");
			return false;
		}
		$("input[id='operacion']").val("<%= Utility.OP_GUARDAR %>");
	});
});
</script>
</head>
<body>
<html:form action="/empresas/OtorgarBeneficios.do" method="post" styleId="mainForm"
	type="co.gov.medellin.ssti.sub.web.form.OtorgarBeneficiosEmpresaForm" >
	<html:hidden name="OtorgarBeneficiosEmpresaForm" property="codigoEmpresa" styleId="codigoEmpresa" />
	<html:hidden name="OtorgarBeneficiosEmpresaForm" property="operacion" styleId="operacion" />
	
	<div align="center">
		<c:if test="${empty OtorgarBeneficiosEmpresaForm.empresaVO.codigo}">		
			<div align="center" class="titulosenblanco">
				<strong>Empresa no encontrada.</strong><br>
				<p>
					<a href="<%=request.getContextPath() + "/empresas/BuscarEmpresa.do"%>">
						<img src="<%=request.getContextPath() + "/images/b_atras.gif"%>"
							width="24" height="15" border="0"><br>
						<span>Atras</span>				
					</a>
				</p>
			</div>
		</c:if>
		<c:if test="${not empty OtorgarBeneficiosEmpresaForm.empresaVO.codigo}">		
			<table class="tablaGenericaWidth70">
				<tr>
					<td class="titulosenblanco" colspan="2">
						<DIV align="center">
							<STRONG>OTORGAR BENEFICIOS EMPRESA</STRONG>					
						</DIV>
					</td>
				</tr>			
						
				<tr>
					<td class="titulosenblanco" colspan="3">&nbsp;</td>
				</tr>
				<tr>
					<td class="titulosenblanco" colspan="3">&nbsp;</td>
				</tr>
				<tr>
					<td class="titulosenblanco" colspan="2">Empresa</td>
				</tr>
				<tr>
					<td class="titulosenblanco" colspan="3">&nbsp;</td>
				</tr>
					
				<tr>
					<td class="celdatabla" width="15%">NIT:</td>
					<td class="celdatabla" width="40%">
						<div class="form">
							${OtorgarBeneficiosEmpresaForm.empresaVO.nitIdupa}
						</div>
					</td>
					<td class="celdatabla" width="45%">&nbsp;</td>
				</tr>
				<tr>
					<td class="celdatabla" width="15%">Razon Social:</td>
					<td class="celdatabla" width="40%">
						<div class="form">
							${OtorgarBeneficiosEmpresaForm.empresaVO.razonSocial}								
						</div>
					</td>
					<td class="celdatabla" width="45%">&nbsp;</td>
				</tr>
						
					
					<tr>
						<td class="titulosenblanco" colspan="3">&nbsp;</td>
					</tr>
					<tr>
						<td class="titulosenblanco" colspan="2">Beneficio</td>
					</tr>
					<tr>
						<td class="titulosenblanco" colspan="3">&nbsp;</td>
					</tr>
					<tr>
						<td class="celdatabla" width="15%">Programa:</td>
						<td width="40%">
							<c:if test="${empty OtorgarBeneficiosEmpresaForm.programas}">							
								<DIV align="center"><!-- ${sessionScope.msg} -->								
									<%=session.getAttribute("msg")%>
									<% session.removeAttribute("msg"); %>
								</DIV>							
							</c:if>	
							<div align="left">
								<c:if test="${not empty OtorgarBeneficiosEmpresaForm.programas}">															
									<html:select property="codigoPrograma" title="Programa"
										styleClass="form" styleId="programas">
										<option value="">Seleccione un programa</option>
										<html:optionsCollection property="programas"
											label="nombre" value="code" />
									</html:select>																
								</c:if>
							</div></td>
						<td class="celdatabla" width="45%">&nbsp;</td>
					</tr>
					
					<c:if test="${not empty OtorgarBeneficiosEmpresaForm.codigoPrograma}">					
						<tr>
							<td class="celdatabla" width="15%">Beneficio:</td>
							<td width="40%">
								<div align="left">
									<c:if test="${empty OtorgarBeneficiosEmpresaForm.subprogramas}">									
										<DIV align="center">
											<%=session.getAttribute("msg")%>
											<% session.removeAttribute("msg"); %>
										</DIV>									
									</c:if>
									<c:if test="${not empty OtorgarBeneficiosEmpresaForm.subprogramas}">																
										<html:select property="codigoSubprograma"
											title="Programa" styleClass="form" styleId="subprogramas">
											<option value="">Seleccione un subprograma</option>
											<html:optionsCollection property="subprogramas"
												label="nombre" value="code"/>
										</html:select>																	
									</c:if>
								</div>
							</td>
							<td class="celdatabla" width="45%">&nbsp;</td>
						</tr>					
					</c:if>
					<tr>
						<td class="titulosenblanco" colspan="3">&nbsp;</td>
					</tr>
					<tr>
						<td class="celdatabla" width="15%">&nbsp;</td>
						<td width="40%">
							<div align="center">							
								<input type="submit" value="Continuar" name="continuarBtn" id="continuarBtn" />
								<P>&nbsp;</P>
							</div>
						</td>
						<td class="celdatabla" width="45%">&nbsp;</td>
					</tr>
					
					<tr>
						<td class="celdatabla" width="15%">&nbsp;</td>
						<td width="40%">
							<div align="center">
								<a href="<%=request.getContextPath()+"/empresas/BuscarEmpresa.do"%>">
									<img src="<%=request.getContextPath()+"/images/b_atras.gif"%>"
										width="24" height="15" border="0"><br> <span>Atras</span>
								</a>
							</div>
					</tr>					
			</table>			
		</c:if>
	</div>
</html:form>
</body>
</html>